package com.jinyu.jyly.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jinyu.jyly.R;
import com.jinyu.jyly.bean.ArticleListInfo;

import java.util.List;


/**
 *
 */
public class HomeTabAdapter extends BaseQuickAdapter<ArticleListInfo, BaseViewHolder> {

    public HomeTabAdapter(List<ArticleListInfo> data, int layoutResIds) {
        super(layoutResIds, data);
    }


    @Override
    protected void convert(final BaseViewHolder helper, final ArticleListInfo item) {
        helper.setText(R.id.tv_title_name,item.getName());
        helper.setText(R.id.tv_desc,item.getDescription());
        helper.setText(R.id.tv_time,item.getCreate_time());

        RequestOptions options = new RequestOptions();
        options.error(R.mipmap.space_list);
        Glide.with(mContext).load(item.getThumb())
                .apply(options)
                .into((ImageView) helper.getView(R.id.iv_img));
    }


}


